#include<iostream> 
#include<cstdio> 
#include<algorithm> 
#include<cmath> 
#define re register int 
using namespace std; 
int n,m,k; 
int g[1000005], r[100005]; 
long long f[5005][5001],sum[5005];

int main() {
    scanf("%d%d%d",&n,&m,&k);
    for(re i=1;i<=n;++i) {
    	scanf("%d",&g[i]);
    	if(i<=m) sum[i]=sum[i-1]+g[i];
    	if(i>m) sum[i]=sum[i-1]-g[i-m]+g[i];
    }
    for(re i=1;i<=n;++i) 
    	for(re j=1;j<=k;++j) {
    		f[i][j]=f[i-1][j];
    		if(i>=m&&f[i-m][j-1]!=-1) f[i][j]=max(f[i][j],f[i-m][j-1]+sum[i]); 
    	}
    printf("%lld\n",f[n][k]);
	return 0;
}

